<template>
    <div id="notFound">
        <t-header></t-header>
        <div style="height: 95%;font-size: 16px;display: inline-block;vertical-align: middle;line-height: initial;text-align: left;">
            <h1>页面不存在.</h1>
            <h1 >{{time}}后跳转到首页</h1>
        </div>

    </div>
</template>
<script>
    import THeader from "@/components/THeader";

    export default {
        name: 'NotFound',
        components: {
            THeader
        },
        computed: {
            user() {
                return this.$store.state.user.info;
            }
        },
        data() {
            return {
                time: 5
            }
        },
        mounted(){
          this.tohome()
        },
        methods: {
            tohome() {
                setInterval(() => {
                    this.time--
                    console.log(this.time == 0)
                    if (this.time == 0) {
                        this.$router.push({name: 'Home'})
                    }
                }, 1000)

            }
        }
    }
</script>

